{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>{% block title %}B站数据可视化与分析{% endblock %}</title>
    <link rel="apple-touch-icon" sizes="180x180" href="{% static "apple-touch-icon.png" %}">
    <link rel="icon" type="image/png" sizes="32x32" href="{% static "favicon-32x32.png" %}">
    <link rel="icon" type="image/png" sizes="16x16" href="{% static "favicon-16x16.png" %}">
    <link href="{% static "css/style.css" %}" rel="stylesheet">
    <!-- Bootstrap -->
    <link href="{% static "bootstrap-3.3.7-dist/css/bootstrap.min.css" %}" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    {% block css %}{% endblock %}
  </head>
  <body id="c">

  {% load static %}
    <nav class="navbar navbar-light" style="background-color: #e3f2fd" id="c">
      <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#my-nav" aria-expanded="false">
            <span class="sr-only">切换导航条</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/index/">B站数据可视化与分析</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="my-nav">
        <!--
        通过if判断，当登录时，显示当前用户名和登出按钮。未登录时，显示登录和注册按钮。
        注意其中的模板语言，{{ request }}这个变量会被默认传入模板中，可以通过圆点的调用方式，
        获取它内部的{{ request.session }}，再进一步的获取session中的内容。其实{{ request }}中的数据远不止此，例如{{ request.path }}就可以获取先前的url地址。
        -->
          <ul class="nav navbar-nav navbar-right">
              {% if request.session.is_login %}
               <li><a href="#" rel="external nofollow">当前在线：{{ request.session.user_name }}</a></li>
               <li><a href="/logout/" rel="external nofollow" >登出</a></li>
              {% else %}
            <li><a href="/admin/" rel="external nofollow" rel="external nofollow" rel="external nofollow">管理员登录</a></li>
            <li><a href="/login/" rel="external nofollow" rel="external nofollow" rel="external nofollow">登录</a></li>
            <li><a href="/register/" rel="external nofollow" rel="external nofollow" rel="external nofollow">注册</a></li>
              {% endif %}
          </ul>
        </div><!-- /.navbar-collapse -->
      </div><!-- /.container-fluid -->
    </nav>

    {% block content %}{% endblock %}


    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="{% static "js/jquery.min.js" %}"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{% static "bootstrap-3.3.7-dist/js/bootstrap.min.js" %}"></script>
  </body>
</html>